package org.lesBonsComptes.android.feedPlayer;

import java.util.ArrayList;


public class SubEvent {
	private long id;
	private String name;
	private String date;
	private double price;
	User payer;
	ArrayList<User> buyers;
	
	
	
	public SubEvent(long id, String name, String date, double price, User payer,
			ArrayList<User> buyers) {
		super();
		this.id = id;
		this.name = name;
		this.date = date;
		this.price = price;
		this.payer = payer;
		this.buyers = buyers;
	}
	
	
	public SubEvent() {
		super();
		this.buyers = new ArrayList<User>();
	}
	
	public String getDate() {
		return date;
	}



	public User getPayer() {
		return payer;
	}



	public void setPayer(User payer) {
		this.payer = payer;
	}



	public ArrayList<User> getBuyers() {
		return buyers;
	}

	public String printBuyers() {
		ArrayList<User> buyers = this.getBuyers();
		String r = "";
		for (User b : buyers) {
			r+= b.getLogin()+", ";
		}
		if(r.length() >= 2) 
			r = r.substring(0, r.length() - 2);
		return r;
	}


	public void setBuyers(ArrayList<User> buyers) {
		this.buyers = buyers;
	}



	public void setDate(String date) {
		this.date = date;
	}



	public double getPrice() {
		return price;
	}



	public void setPrice(double price) {
		this.price = price;
	}





	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}


	@Override
	public String toString() {
		return "SubEvent [id=" + id + ", name=" + name + ", date=" + date
				+ ", price=" + price + ", payer=" + payer + ", buyers="
				+ buyers + "]";
	}
	
	
}
